home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / disk_utl / advapp / advapp.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-05-29  |  15.0 KB  |  475 lines

  1. VERSION 2.00
  2. Begin Form frmAdvancedApplications 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "Select Desired Disk/File Information"
  6.    ClientHeight    =   4575
  7.    ClientLeft      =   1710
  8.    ClientTop       =   1875
  9.    ClientWidth     =   8325
  10.    Height          =   4980
  11.    Icon            =   0
  12.    Left            =   1650
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   4575
  17.    ScaleWidth      =   8325
  18.    Top             =   1530
  19.    Width           =   8445
  20.    Begin CommandButton cmdSystem 
  21.       Caption         =   "S&ystem..."
  22.       Height          =   375
  23.       Left            =   120
  24.       TabIndex        =   27
  25.       Top             =   3120
  26.       Width           =   1575
  27.    End
  28.    Begin CommandButton cmdCreateDir 
  29.       Caption         =   "Di&rectory..."
  30.       Height          =   375
  31.       Left            =   2280
  32.       TabIndex        =   10
  33.       Top             =   4080
  34.       Width           =   1815
  35.    End
  36.    Begin CommandButton cmdPathWord 
  37.       Caption         =   "S&plit Word..."
  38.       Height          =   375
  39.       Left            =   2280
  40.       TabIndex        =   9
  41.       Top             =   3600
  42.       Width           =   1815
  43.    End
  44.    Begin CommandButton cmdSearchList 
  45.       Caption         =   "&Search..."
  46.       Height          =   375
  47.       Left            =   2280
  48.       TabIndex        =   8
  49.       Top             =   3120
  50.       Width           =   1815
  51.    End
  52.    Begin CommandButton cmdCopy 
  53.       Caption         =   "&Move/Copy File..."
  54.       Height          =   375
  55.       Left            =   2280
  56.       TabIndex        =   7
  57.       Top             =   2640
  58.       Width           =   1815
  59.    End
  60.    Begin CommandButton cmdAbout 
  61.       Caption         =   "&About..."
  62.       Height          =   375
  63.       Left            =   120
  64.       TabIndex        =   6
  65.       Top             =   3600
  66.       Width           =   1575
  67.    End
  68.    Begin CommandButton cmdSample 
  69.       Caption         =   "&?"
  70.       Height          =   375
  71.       Left            =   1320
  72.       TabIndex        =   5
  73.       Top             =   2640
  74.       Width           =   375
  75.    End
  76.    Begin CommandButton cmdHelp 
  77.       Caption         =   "&Help"
  78.       Height          =   375
  79.       Left            =   120
  80.       TabIndex        =   4
  81.       Top             =   2640
  82.       Width           =   1095
  83.    End
  84.    Begin PictureBox picDrive 
  85.       BackColor       =   &H00C0C0C0&
  86.       Height          =   2415
  87.       Left            =   120
  88.       ScaleHeight     =   2385
  89.       ScaleWidth      =   3945
  90.       TabIndex        =   23
  91.       Top             =   120
  92.       Width           =   3975
  93.       Begin CommandButton cmdDiskSpace 
  94.          Caption         =   "&Free Space"
  95.          Height          =   375
  96.          Index           =   0
  97.          Left            =   120
  98.          TabIndex        =   1
  99.          Top             =   120
  100.          Width           =   1455
  101.       End
  102.       Begin ComboBox cboDrive 
  103.          Height          =   300
  104.          Left            =   1440
  105.          Style           =   2  'Dropdown List
  106.          TabIndex        =   0
  107.          Top             =   1920
  108.          Width           =   2415
  109.       End
  110.       Begin CommandButton cmdDiskSpace 
  111.          Caption         =   "&Total Space"
  112.          Height          =   375
  113.          Index           =   1
  114.          Left            =   120
  115.          TabIndex        =   2
  116.          Top             =   600
  117.          Width           =   1455
  118.       End
  119.       Begin CommandButton cmdClear 
  120.          Caption         =   "&Clear Labels"
  121.          Height          =   375
  122.          Left            =   1680
  123.          TabIndex        =   3
  124.          Top             =   1080
  125.          Width           =   2175
  126.       End
  127.       Begin Label lblFreeSpace 
  128.          BackColor       =   &H00C0C0C0&
  129.          BorderStyle     =   1  'Fixed Single
  130.          Caption         =   "Disk Free Space"
  131.          Height          =   255
  132.          Left            =   1680
  133.          TabIndex        =   16
  134.          Top             =   190
  135.          Width           =   2175
  136.       End
  137.       Begin Label lblTotalSpace 
  138.          BackColor       =   &H00C0C0C0&
  139.          BorderStyle     =   1  'Fixed Single
  140.          Caption         =   "Disk Total Space"
  141.          Height          =   255
  142.          Left            =   1680
  143.          TabIndex        =   19
  144.          Top             =   670
  145.          Width           =   2175
  146.       End
  147.       Begin Label Label3 
  148.          BackColor       =   &H00C0C0C0&
  149.          Caption         =   "Test Drive:"
  150.          Height          =   255
  151.          Left            =   120
  152.          TabIndex        =   24
  153.          Top             =   1950
  154.          Width           =   1215
  155.       End
  156.       Begin Line Line2 
  157.          X1              =   120
  158.          X2              =   3840
  159.          Y1              =   1680
  160.          Y2              =   1680
  161.       End
  162.    End
  163.    Begin PictureBox picFileMode 
  164.       BackColor       =   &H00C0C0C0&
  165.       Height          =   3975
  166.       Left            =   4200
  167.       ScaleHeight     =   3945
  168.       ScaleWidth      =   3945
  169.       TabIndex        =   20
  170.       Top             =   120
  171.       Width           =   3975
  172.       Begin CommandButton cmdCheckFile 
  173.          Caption         =   "C&heck File"
  174.          Height          =   375
  175.          Left            =   1320
  176.          TabIndex        =   17
  177.          Top             =   3360
  178.          Width           =   1455
  179.       End
  180.       Begin TextBox txtFile 
  181.          Height          =   285
  182.          Left            =   1080
  183.          TabIndex        =   11
  184.          Text            =   "Text1"
  185.          Top             =   120
  186.          Width           =   2775
  187.       End
  188.       Begin Frame Frame1 
  189.          BackColor       =   &H00C0C0C0&
  190.          Caption         =   "Select File Mode"
  191.          Height          =   1815
  192.          Left            =   120
  193.          TabIndex        =   21
  194.          Top             =   480
  195.          Width           =   3735
  196.          Begin OptionButton optFileMode 
  197.             BackColor       =   &H00C0C0C0&
  198.             Caption         =   "Check for Read/Write Permission."
  199.             Height          =   255
  200.             Index           =   3
  201.             Left            =   120
  202.             TabIndex        =   15
  203.             Top             =   1440
  204.             Width           =   3495
  205.          End
  206.          Begin OptionButton optFileMode 
  207.             BackColor       =   &H00C0C0C0&
  208.             Caption         =   "Check for Read Permission."
  209.             Height          =   255
  210.             Index           =   2
  211.             Left            =   120
  212.             TabIndex        =   14
  213.             Top             =   1080
  214.             Width           =   3015
  215.          End
  216.          Begin OptionButton optFileMode 
  217.             BackColor       =   &H00C0C0C0&
  218.             Caption         =   "Check for Write Permission."
  219.             Height          =   255
  220.             Index           =   1
  221.             Left            =   120
  222.             TabIndex        =   13
  223.             Top             =   720
  224.             Width           =   3015
  225.          End
  226.          Begin OptionButton optFileMode 
  227.             BackColor       =   &H00C0C0C0&
  228.             Caption         =   "Existance Check."
  229.             Height          =   255
  230.             Index           =   0
  231.             Left            =   120
  232.             TabIndex        =   12
  233.             Top             =   360
  234.             Width           =   3015
  235.          End
  236.       End
  237.       Begin Label Label2 
  238.          Alignment       =   2  'Center
  239.          BackColor       =   &H00C0C0C0&
  240.          BorderStyle     =   1  'Fixed Single
  241.          Caption         =   "Status:"
  242.          Height          =   735
  243.          Left            =   120
  244.          TabIndex        =   26
  245.          Top             =   2400
  246.          Width           =   735
  247.       End
  248.       Begin Label lblFileMode 
  249.          Alignment       =   2  'Center
  250.          BackColor       =   &H00C0C0C0&
  251.          BorderStyle     =   1  'Fixed Single
  252.          Height          =   735
  253.          Left            =   840
  254.          TabIndex        =   25
  255.          Top             =   2400
  256.          Width           =   3015
  257.       End
  258.       Begin Label Label1 
  259.          BackColor       =   &H00C0C0C0&
  260.          Caption         =   "Dir or File:"
  261.          Height          =   255
  262.          Left            =   120
  263.          TabIndex        =   22
  264.          Top             =   170
  265.          Width           =   975
  266.       End
  267.    End
  268.    Begin CommandButton cmdExit 
  269.       Caption         =   "E&xit"
  270.       Height          =   375
  271.       Left            =   120
  272.       TabIndex        =   18
  273.       Top             =   4080
  274.       Width           =   1575
  275.    End
  276. '''''''''''''''''''''''''''''''''''''''''''''''''
  277. ' Copyright by Advanced Applications 1994 - 1995
  278. ' All rights reserved
  279. '''''''''''''''''''''''''''''''''''''''''''''''''
  280. Dim nFileMode As Integer        ' Used by Drive Check Type
  281. Sub cmdAbout_Click ()
  282.     nReturn% = AboutBox()
  283. End Sub
  284. Sub cmdCheckFile_Click ()
  285.     strDrive$ = Trim(txtFile.Text)      ' Must be a String
  286.     ''''''''''''''''''''''''''''''''''''''''''''''
  287.     ' Check the Drive.
  288.     '
  289.     bDriveCheck = DriveCheck(strDrive$, nFileMode)
  290.     If bDriveCheck = FILE_EXISTS Then
  291.     strMessage$ = "Directory/File Exists"
  292.     strMessage$ = strMessage$ & Chr$(KEY_RETURN)
  293.     strMessage$ = strMessage$ & "and/or"
  294.     strMessage$ = strMessage$ & Chr$(KEY_RETURN)
  295.     strMessage$ = strMessage$ & "Mode Is Accessible."
  296.     Else
  297.     strMessage$ = "Directory/File Does Not Exist"
  298.     strMessage$ = strMessage$ & Chr$(KEY_RETURN)
  299.     strMessage$ = strMessage$ & "and/or"
  300.     strMessage$ = strMessage$ & Chr$(KEY_RETURN)
  301.     strMessage$ = strMessage$ & "Mode Is Not Accessible."
  302.     End If
  303.     ' Display the message
  304.     lblFileMode.Caption = strMessage$
  305. End Sub
  306. Sub cmdClear_Click ()
  307.     lblFreeSpace.Caption = ""       ' Clears Labels
  308.     lblTotalSpace.Caption = ""
  309. End Sub
  310. Sub cmdCopy_Click ()
  311.     frmMove.Show MODAL
  312. End Sub
  313. Sub cmdCreateDir_Click ()
  314.     frmCreateDir.Show MODAL
  315. End Sub
  316. Sub cmdDiskSpace_Click (Index As Integer)
  317.     If cboDrive.Text = "Default" Then
  318.     nDrive% = 0
  319.     Else
  320.     strDrive$ = Left(cboDrive.Text, 1)
  321.     nDrive% = Asc(strDrive$) - 64
  322.     End If
  323.     Select Case Index
  324.     Case FREE_SPACE
  325.         lblFreeSpace.Caption = ""
  326.         DoEvents
  327.         
  328.         Screen.MousePointer = HOURGLASS
  329.         ''''''''''''''''''''''''''''''''''''''''''''
  330.         ' Find the Free Space for the Selected Drive
  331.         '
  332.         lDriveInfo = DiskFreeSpace(nDrive%)
  333.         Screen.MousePointer = DEFAULT
  334.         
  335.         ' Did an error occur?
  336.         If lDriveInfo <= DISK_FULL And lDriveInfo >= FILE_NOT_FOUND Then
  337.         DisplayError lDriveInfo
  338.         Exit Sub
  339.         End If
  340.         
  341.         ' Display the Information
  342.         lblFreeSpace.Caption = lDriveInfo & " Bytes"
  343.     Case TOTAL_SPACE
  344.         lblTotalSpace.Caption = ""
  345.         DoEvents
  346.         Screen.MousePointer = HOURGLASS
  347.         
  348.         ''''''''''''''''''''''''''''''''''''''''''''
  349.         ' Find the Total Space for the Selected Drive
  350.         '
  351.         lDriveInfo = DiskTotalSpace(nDrive%)
  352.         
  353.         Screen.MousePointer = DEFAULT
  354.         
  355.         ' Did an error occur?
  356.         If lDriveInfo <= DISK_FULL And lDriveInfo >= FILE_NOT_FOUND Then
  357.         DisplayError lDriveInfo
  358.         Exit Sub
  359.         End If
  360.         ' Display the information
  361.         lblTotalSpace.Caption = lDriveInfo & " Bytes"
  362.     End Select
  363. End Sub
  364. Sub cmdExit_Click ()
  365.     End
  366. End Sub
  367. Sub cmdHelp_Click ()
  368.      ' Run the Advanced Application Disk Help File
  369.      strHelp = "winhelp " & App.Path & "\ADVDISK.HLP"
  370.      X = Shell(strHelp, 1)
  371. End Sub
  372. Sub cmdPathWord_Click ()
  373.     frmPathWord.Show MODAL
  374. End Sub
  375. Sub cmdSample_Click ()
  376.     SendKeys "{F1}", True       ' Force Help to Samples
  377. End Sub
  378. Sub cmdSearchList_Click ()
  379.     szBuffer$ = String(255, 0)
  380.     strPath$ = "C:\*.*"
  381.     nLength% = SearchList(strPath$, szBuffer$)
  382.     If nLength% = 0 Then
  383.     MsgBox "Search Item not returned", , "Search List Return Error"
  384.     Exit Sub
  385.     End If
  386.     strWord$ = Left$(szBuffer$, nLength%)
  387.     MsgBox "Search Item Returned: " & strWord$, , "Search List Return Error"
  388. End Sub
  389. Sub cmdSystem_Click ()
  390.     frmOperations.Show MODAL
  391. End Sub
  392. Sub Form_Load ()
  393.     Left = (Screen.Width - Width) / 2   ' Center form horizontally.
  394.     Top = (Screen.Height - Height) / 2  ' Center form vertically.
  395.     lblFreeSpace.Caption = ""           ' Clear labels
  396.     lblTotalSpace.Caption = ""
  397.     txtFile.Text = ""                   ' Clear Text
  398.     nFileMode = EXISTANCE_CHECK         ' Default Value
  399.     optFileMode(0).Value = True
  400.     ' Find the system drives and fill the Drive Combo Box
  401.     ' Starting with "Drive A" to "Drive Z".
  402.     cboDrive.Clear
  403.     cboDrive.AddItem "Default"
  404.     For I% = 0 To 25
  405.     nDrive% = DriveType(I%)
  406.     If nDrive% <> DRIVE_UNDETERMINED And nDrive% <> DRIVE_NOT_VALID Then
  407.         If nDrive% < 10 Then
  408.         nCompress% = nDrive%
  409.         Else
  410.         nCompress% = nDrive% - 10
  411.         End If
  412.         Select Case nCompress%
  413.         Case DRIVE_REMOVABLE
  414.             strDrive$ = "[Floppy"
  415.         Case DRIVE_FIXED
  416.             strDrive$ = "[Fixed"
  417.         Case DRIVE_REMOTE
  418.             strDrive$ = "[Network"
  419.         Case DRIVE_CDROM
  420.             strDrive$ = "[CDRom"
  421.         Case DRIVE_RAM
  422.             strDrive$ = "[RAM"
  423.         Case Else
  424.             strDrive$ = ""
  425.         End Select
  426.         If nDrive% > 10 Then
  427.         strDrive$ = strDrive$ & " (Compressed)]"
  428.         Else
  429.         strDrive$ = strDrive$ & "]"
  430.         End If
  431.         
  432.         strTemp$ = Chr$(65 + I%) & ": "
  433.         strTemp$ = strTemp$ & strDrive$
  434.         cboDrive.AddItem strTemp$
  435.     End If
  436.     Next
  437.     ' Select the Default Drive, Default = 0
  438.     cboDrive.ListIndex = DEFAULT_DRIVE
  439.     ' Setup the Help Context
  440.     App.HelpFile = App.Path & "\ADVDISK.HLP"
  441.     ' Main Form Help Context ID's
  442.     frmAdvancedApplications.HelpContextID = HLP_SAMPLE
  443.     cboDrive.HelpContextID = HLP_DRIVE_TYPE
  444.     cmdCheckFile.HelpContextID = HLP_DRIVE_CHECK
  445.     cmdDiskSpace(0).HelpContextID = HLP_FREE_SPACE
  446.     cmdDiskSpace(1).HelpContextID = HLP_TOTAL_SPACE
  447.     cmdCopy.HelpContextID = HLP_MOVE_FILE
  448.     cmdSample.HelpContextID = HLP_SAMPLE
  449.     cmdAbout.HelpContextID = HLP_ABOUTBOX
  450.     cmdSearchList.HelpContextID = HLP_SEARCH
  451.     cmdPathWord.HelpContextID = HLP_SPLIT_WORD
  452.     cmdCreateDir.HelpContextID = HLP_DIRECTORY
  453.     ' Move Form Help Context ID's
  454.     cmdCheckFile.HelpContextID = HLP_FILE_EXISTS
  455.     frmMove.cmdTo.HelpContextID = HLP_FILE_EXISTS
  456.     frmMove.cmdFrom.HelpContextID = HLP_FILE_EXISTS
  457.     frmMove.HelpContextID = HLP_MOVE_FILE
  458.     ' Create/Delete Directory Help Context ID's
  459.     frmCreateDir.cmdOK(0).HelpContextID = HLP_CREATE_PATH
  460.     frmCreateDir.cmdOK(1).HelpContextID = HLP_DELETE_PATH
  461. End Sub
  462. Sub optFileMode_Click (Index As Integer)
  463.     ' Set the Drive Check Type Mode
  464.     Select Case Index
  465.     Case 0
  466.         nFileMode = EXISTANCE_CHECK
  467.     Case 1
  468.         nFileMode = WRITE_CHECK
  469.     Case 2
  470.         nFileMode = READ_CHECK
  471.     Case 3
  472.         nFileMode = READ_WRITE_CHECK
  473.     End Select
  474. End Sub
  475.